<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <script type="text/javascript" src="<%=path %>/js/jquery-1.8.3.js"></script>
    <base href="<%=basePath%>">
    <script type="text/javascript">
    	$(function(){
    			$.post(
    				"<%=path%>/work/findCompanyList.controller",
    				function(result){
    					for(var i in result){
    					console.log(result)
    						$("#cid").append("<option value='"+result[i].cid+"'>"+result[i].cname+"</option>")
    					}
    				},
    				"json"
    			)
    			$.post(
    				"<%=path%>/work/findPositionList.controller",
    				function(result){
    					for(var i in result){
    					console.log(result)
    						$("#pid").append("<option value='"+result[i].pid+"'>"+result[i].pname+"</option>")
    					}
    				},
    				"json"
    			)
    	});
    
    </script>
    
  </head>
  
  <body>
   		<form action="<%=path%>/work/addall.controller" method="post">
   			<table>
   					<tr>
   							<td>
   					姓名:<input type="text" name="name">
  						
   							</td>
   							
   					</tr>
   					<tr>
   							<td>
   					年龄:<input type="text" name="age">
  						
   							</td>
   							
   					</tr>
   					<tr>
   							<td>
   					爱好:<input type="text" name="hobby">
  						
   							</td>
   							
   					</tr>
   					
   					<tr>
   							<td>
   					公司:
   					<select name="cid" id="cid">
   						
   					</select>
  						
   							</td>
   							
   					</tr>
   					<tr>
   							<td>
   					职位:
   					<select name="pid" id="pid">
   					</select>
  						
   							</td>
   							
   					</tr>
   					<tr>
   							<td>
   					<input type="submit" value="批量添加" >
  						
   							</td>
   							
   					</tr>
   			</table>
   		
   		</form>
  </body>
</html>
